package cn.itsource.feign.user;


import cn.itsource.domain.user.User;
import cn.itsource.fallback.user.UserFeignFallBack;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

//通过服务名找到对应服务的ip+端口  localhost:4001/hjdosahfipsajpo/user/user/findOne/{id}
@FeignClient(value = "user-server",fallback = UserFeignFallBack.class)
@RequestMapping("hjdosahfipsajpo/user")
public interface UserFeignClient {

    @GetMapping(value = "user/findOne/{id}")
     User findOne(@PathVariable Long id);

    @GetMapping("user/findAll")
    public List<User> findAll();
}
